package com.csun.cmny.provider.dao;

import com.csun.cmny.provider.model.domain.DmcCsunSleepDataAction;
import com.csun.cmny.provider.model.dto.app.AppSleepDateQueryDto;
import com.csun.cmny.provider.model.dto.csunsleep.CsunSleepDataActionQueryDto;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface DmcCsunSleepDataActionMapper extends Mapper<DmcCsunSleepDataAction> {

    /**
     * 条件查询翻身数据
     * @param: [csunSleepDataActionQueryDto]
     * @return: java.util.List<com.csun.cmny.provider.model.domain.DmcCsunSleepDataAction>
     */
    List<DmcCsunSleepDataAction> queryCsunSleepDataActionList(CsunSleepDataActionQueryDto csunSleepDataActionQueryDto);

    /**
     * 根据设备id查询最近插入的数据
     * @param: [deviceId]
     * @return: com.csun.cmny.provider.model.domain.DmcCsunSleepDataAction
     */
    DmcCsunSleepDataAction getLatestActionDataByDeviceId(@Param("deviceId") Long deviceId);

    /**
     * 统计翻身报警次数
     * @param: [appSleepDateQueryDto]
     * @return: java.lang.Integer
     */
    Integer countActionAlertTimes(AppSleepDateQueryDto appSleepDateQueryDto);
}